//
//  LcTimerOnce.h
//  18Birdies
//
//  Created by weihua on 2017/3/16.
//  Copyright © 2017年 Lc. All rights reserved.
//

#import <Foundation/Foundation.h>

@class LcTimerOnce;
typedef void (^TimerOnceBlock)(LcTimerOnce* timer);

@interface LcTimerOnce : NSObject

@property(nonatomic, copy) NSString* name;
@property(nonatomic, strong) id userInfo;
@property(nonatomic, readonly) NSTimeInterval fireIn;

/**
 Create timer use dispatch_get_main_queue()
 @return LcTimerOnce
 */
+ (instancetype)timerWithBlock:(TimerOnceBlock)block;
+ (instancetype)timerWithBlock:(TimerOnceBlock)block queue:(dispatch_queue_t)queue;

- (instancetype)initWithBlock:(TimerOnceBlock)block queue:(dispatch_queue_t)queue;

- (void)startIn:(NSTimeInterval)startIn;
- (void)cancel;

@end
